//package com.qlk.test.odcinterface.service;
//
//import java.util.List;
//
//import org.junit.Test;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.util.Assert;
//
//import com.qlk.odcinterface.domain.PmsFullCutChannel;
//import com.qlk.odcinterface.domain.query.PmsFullCutChannelQuery;
//import com.qlk.odcinterface.service.PmsFullCutChannelService;
//import com.qlk.odcinterface.utils.exceptions.ExistedException;
//import com.qlk.common.utils.page.PageUtil;
//import com.qlk.test.base.BaseTransactionTestCase;
//import com.qlk.test.base.TestConstants;
//
///**
// * PmsFullCutChannelService单元测试
// *
// * @author zhaoyanan
// * @version 2016-4-14 13:22:59
// *
// */
//public class PmsFullCutChannelServiceTestCase extends BaseTransactionTestCase {
//
//    /** 不存在的 ID-删改查-失败的测试用例 */
//    private static final long TEST_NOT_EXIST_ID = -2L;
//
//    /** 默认 存在的ID-删改查-成功的测试用例,数据库需存在改ID对应的数据 */
//    private static final long TEST_DEFAULT_EXIST_ID = 1L;
//
//    @Autowired
//    private PmsFullCutChannelService pmsFullCutChannelService;
//
//    /**
//     * 测试插入数据-成功
//     */
//    @Test
//    public void testInsert() {
//        Assert.notNull(pmsFullCutChannelService);
//        PmsFullCutChannel pmsFullCutChannel = new PmsFullCutChannel();
//        Integer promotionId = null; //TODO 初始化
//        pmsFullCutChannel.setPromotionId(promotionId);
//        Integer channelId = null; //TODO 初始化
//        pmsFullCutChannel.setChannelId(channelId);
////        pmsFullCutChannel.setCreateUser(TestConstants.UER_NAME);
//        boolean result = pmsFullCutChannelService.insert(pmsFullCutChannel);
//        Assert.isTrue(result);
//    }
//
//    /**
//     * 测试插入数据-失败（重复、错误、长度越界等）
//     */
//    @Test
//    public void testInsertFailure() {
//        Assert.notNull(pmsFullCutChannelService);
//        PmsFullCutChannel pmsFullCutChannel = new PmsFullCutChannel();
//        Integer promotionId = null; //TODO 初始化// 已经存在的
//        pmsFullCutChannel.setPromotionId(promotionId);
//        Integer channelId = null; //TODO 初始化// 已经存在的
//        pmsFullCutChannel.setChannelId(channelId);
////        pmsFullCutChannel.setCreateUser(TestConstants.UER_NAME);
//        ExistedException ex = null;
//        try {
//            boolean result = pmsFullCutChannelService.insert(pmsFullCutChannel);
//            Assert.isTrue(!result);
//        } catch (ExistedException e) {
//            ex = e;
//        }
//        Assert.notNull(ex);
//    }
//
//    /**
//     * 测试删除数据-成功
//     */
//    @Test
//    public void testDelete() {
//        Assert.notNull(pmsFullCutChannelService);
//        PmsFullCutChannel pmsFullCutChannel = new PmsFullCutChannel();
////        pmsFullCutChannel.setId(TEST_DEFAULT_EXIST_ID);
//        Integer promotionId = null; //TODO 初始化
//        pmsFullCutChannel.setPromotionId(promotionId);
//        Integer channelId = null; //TODO 初始化
//        pmsFullCutChannel.setChannelId(channelId);
////        pmsFullCutChannel.setUpdateUser(TestConstants.UER_NAME);
//        boolean result = pmsFullCutChannelService.delete(pmsFullCutChannel);
//        Assert.isTrue(result);
//    }
//
//    /**
//     * 测试删除数据-失败（ID不存在等）
//     */
//    @Test
//    public void testDeleteFailure() {
//        Assert.notNull(pmsFullCutChannelService);
//        PmsFullCutChannel pmsFullCutChannel = new PmsFullCutChannel();
////        pmsFullCutChannel.setId(TEST_NOT_EXIST_ID);// 不存在的ID
//        Integer promotionId = null; //TODO 初始化
//        pmsFullCutChannel.setPromotionId(promotionId);
//        Integer channelId = null; //TODO 初始化
//        pmsFullCutChannel.setChannelId(channelId);
////        pmsFullCutChannel.setUpdateUser(TestConstants.UER_NAME);
//        boolean result = pmsFullCutChannelService.delete(pmsFullCutChannel);
//        Assert.isTrue(!result);
//    }
//
//    /**
//     * 测试修改数据-成功
//     */
//    @Test
//    public void testUpdate() {
//        Assert.notNull(pmsFullCutChannelService);
//        PmsFullCutChannel pmsFullCutChannel = new PmsFullCutChannel();
////        pmsFullCutChannel.setId(TEST_DEFAULT_EXIST_ID);
//        Integer promotionId = null; //TODO 初始化
//        pmsFullCutChannel.setPromotionId(promotionId);
//        Integer channelId = null; //TODO 初始化
//        pmsFullCutChannel.setChannelId(channelId);
////        pmsFullCutChannel.setUpdateUser(TestConstants.UER_NAME);
//        boolean result = pmsFullCutChannelService.update(pmsFullCutChannel);
//        Assert.isTrue(result);
//    }
//
//    /**
//     * 测试修改数据-失败（ID不存在等）
//     */
//    @Test
//    public void testUpdateFailure() {
//        Assert.notNull(pmsFullCutChannelService);
//        PmsFullCutChannel pmsFullCutChannel = new PmsFullCutChannel();
////        pmsFullCutChannel.setId(TEST_NOT_EXIST_ID);// 不存在的ID
//        Integer promotionId = null; //TODO 初始化
//        pmsFullCutChannel.setPromotionId(promotionId);
//        Integer channelId = null; //TODO 初始化
//        pmsFullCutChannel.setChannelId(channelId);
////        pmsFullCutChannel.setUpdateUser(TestConstants.UER_NAME);
//        boolean result = pmsFullCutChannelService.update(pmsFullCutChannel);
//        Assert.isTrue(!result);
//    }
//
//    /**
//     * 测试依据ID查询数据-成功
//     */
//    @Test
//    public void testQuery() {
//        Assert.notNull(pmsFullCutChannelService);
////        PmsFullCutChannel c = pmsFullCutChannelService.getPmsFullCutChannelById(TEST_DEFAULT_EXIST_ID);
////        Assert.notNull(c);
//    }
//
//    /**
//     * 测试依据ID查询数据-失败（ID不存在等）
//     */
//    @Test
//    public void testQueryFailure() {
//        Assert.notNull(pmsFullCutChannelService);
////        PmsFullCutChannel c = pmsFullCutChannelService.getPmsFullCutChannelById(TEST_NOT_EXIST_ID);// 不存在的ID
////        Assert.isNull(c);
//    }
//
//    /**
//     * 测试分页查询数据-成功
//     */
//    @Test
//    public void testQueryWithPage() {
//        Assert.notNull(pmsFullCutChannelService);
//        PmsFullCutChannelQuery queryBean = null;
//        PageUtil pageUtil = null;
//        List<PmsFullCutChannel> list = pmsFullCutChannelService.queryPmsFullCutChannelListWithPage(
//                queryBean, pageUtil);
//        Assert.notEmpty(list);
//        logger.info("list size = " + list.size());
//    }
//
//    /**
//     * 测试查询数据集合-成功
//     */
//    @Test
//    public void testQueryList() {
//        Assert.notNull(pmsFullCutChannelService);
//        PmsFullCutChannelQuery queryBean = new PmsFullCutChannelQuery();
//        Integer promotionId = null; //TODO 初始化
//        queryBean.setPromotionId(promotionId);
//        Integer channelId = null; //TODO 初始化
//        queryBean.setChannelId(channelId);
//        List<PmsFullCutChannel> list = pmsFullCutChannelService.queryPmsFullCutChannelList(queryBean);
//        Assert.notEmpty(list);
//        logger.info("list size = " + list.size());
//    }
//}
